package cn.lili.modules.system.entity.dos;

import java.math.BigDecimal;

import cn.lili.mybatis.model.BaseStandardEntity;
import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDate;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 会员流水表
 * </p>
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("li_vip_flow")
@ApiModel(value="LiVipFlow", description="会员流水表")
public class LiVipFlow  extends BaseStandardEntity implements Serializable {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "用户ID")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty(value = "用户名")
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "会员ID")
    @TableField("vip_config_id")
    private String vipConfigId;

    @ApiModelProperty(value = "会员名称")
    @TableField("vip_config_name")
    private String vipConfigName;

    @ApiModelProperty(value = "支付金额")
    @TableField("pay_price")
    private BigDecimal payPrice;

    @ApiModelProperty(value = "支付时间")
    @TableField("pay_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @ApiModelProperty(value = "流水类型：1微信，2支付宝，3余额，4绿色积分，5激活码。字典：pay_way")
    @TableField("flow_type")
    private Integer flowType;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "激活码")
    @TableField("active_code")
    private String activeCode;

    @ApiModelProperty(value = "添加时长（单位：月）")
    @TableField("add_time")
    private Integer addTime;

    public String addRemark(LocalDate date,String payWay){
        return date+"通过"+payWay+"充值PLUS会员";
    }
}
